    var timer;
    var index;
    var len=$("ul.number>li").length;
$(document).ready(function() {
	/*----------------建筑类页面----------------*/
    /*导航下拉*/
	$(".menuA").hover(function(){
		$(".detaProgress").show();
		$(this).addClass("ons");
	},function(){
		$(".detaProgress").hide();
		$(this).removeClass("ons");
	});
	/*在想题库和考试辅导的右边栏特效*/
	$(".tiLeft ul li").click(function(){
		$(this).addClass("on").siblings("li").removeClass("on");
	})
	$(".tiRight ul li").click(function(){
		$(this).addClass("out").siblings("li").removeClass("out");
	})
	/*首页轮播*/
	addPhoto();
    $(window).resize(function () {
            resetSize();
			clearInterval(timer);
    }); 
	$("ul.number li").mouseover(function(){
		index=$(this).index();
		slideImg(index);
	}).eq(0).mouseover();
	$(".show").hover(function(){
		clearInterval(timer);
	},function(){
		timer=setInterval(function(){
		slideImg(index);
		index++;
		if(index==len) index=0;
		},10000);
	}).trigger("mouseleave");
	

});
function slideImg(index){
	var v_width=$(".slider ul.show li img").width();
	$(".show").stop(true,false).animate({left:-v_width*index},600);
	$(".number li").eq(index).find("p").find("img").addClass("on").parents("li").siblings("li").find("p").find("img").removeClass("on");
	
}
/*适应屏幕宽度*/
/*触发屏幕，改变屏幕大小时触发onresize()*/
function addPhoto(){
	var imgList2560 =["images/banner2_2560.jpg","images/banner3_2560.jpg","images/banner4_2560.jpg",
"images/banner5_2560.jpg","images/banner6_2560.jpg","images/banner7_2560.jpg"];
    var imgList1920 =["images/banner2_1920.jpg","images/banner3_1920.jpg","images/banner4_1920.jpg",
"images/banner5_1920.jpg","images/banner6_1920.jpg","images/banner7_1920.jpg"];
     var imgList1366 =["images/banner2_1366.jpg","images/banner3_1366.jpg","images/banner4_1366.jpg",
"images/banner5_1366.jpg","images/banner6_1366.jpg","images/banner7_1366.jpg"];
    var imgSrc=$(".show img").attr("src");
	if(document.body.clientWidth<=2560&&document.body.clientWidth>1920){
		     imgSrc="images/banner1_2560.jpg";
			 $(".show img").attr("src",imgSrc);
	}else if(document.body.clientWidth<=1920&&document.body.clientWidth>1366){
		     imgSrc="images/banner1_1920.jpg";
			 $(".show img").attr("src",imgSrc);
	}else if(document.body.clientWidth<=1366){
			 imgSrc="images/banner1_1366.jpg";
			 $(".show img").attr("src",imgSrc);
		  }
	for(var i = 0 ; i <imgList1920.length;i++)
    {
		  var img2560 = new Image();
          img2560.src =imgList2560[i];
          var img1920 = new Image();
          img1920.src =imgList1920[i];
          var img1366 = new Image();
          img1366.src =imgList1366[i];
		  if(document.body.clientWidth<=2560&&document.body.clientWidth>1920){
		     $("<li/>").append(img2560).appendTo("ul.show");
	      }else if(document.body.clientWidth<=1920&&document.body.clientWidth>1366){
		     $("<li/>").append(img1920).appendTo("ul.show");
	      }else
		   if(document.body.clientWidth<=1366){
			 $("<li/>").append(img1366).appendTo("ul.show");
		  }
    }
	
	 resetSize();
}

function resetSize(){
	//全局变量count
	var count = document.getElementById("thelist").getElementsByTagName("img").length;
		
	//加载页面时让每张图片适应屏幕宽高
	//alert(document.body.clientWidth)
	for(i=0;i<count;i++){
        document.getElementById("thelist").getElementsByTagName("img").item(i).style.width =document.body.clientWidth+"px";
    }
	
     //加载页面时让整体图片适应屏幕宽高
     document.getElementById("thelist").style.cssText = " width:"+document.body.clientWidth*count+"px";
}


